package com.ikangtai.shecare.common.eventBusMsg;

import com.ikangtai.shecare.common.util.AppLog;

public class LoginDownloadMsg {
    public boolean isDataDownloaded = true; //表示数据是否曾经download到本地过
    public boolean downloadUserPreferenceOK = false; //下载数据到本地用户信息表，详见DatabaseHelper.USER_PREFERENCE_TABLE_NAME
    public boolean downloadHeadPhotoOK = false; //下载头像
    public boolean downloadSysTaskOK = false; //系统任务

    public boolean downloadCollectedArticlesOK = false; //下载收藏到本地收藏表，和缓存
    public boolean downloadCompleteTaskIDsOK = false; //下载完成任务
    public boolean downloadRecordLHAndHCGAndBUDatasOK = false; //下载试纸信息
    public boolean downloadAlgorithmDataOK = false;  //下载算法相关数据
    public boolean downloadRecordInfoOK = false; //下载记录信息数据

    public boolean isAllDataReady() {
        AppLog.i("1) hxiao -------- isDataDownloadedOK = " + isDataDownloadedOK()
                + ", downloadUserPreferenceOK = " + downloadUserPreferenceOK + ", downloadCollectedArticlesOK = " + downloadCollectedArticlesOK
                + ", downloadHeadPhotoOK = " + downloadHeadPhotoOK + ", downloadCompleteTaskIDsOK = " + downloadCompleteTaskIDsOK
                + ", downloadRecordLHAndHCGAndBUDatasOK = " + downloadRecordLHAndHCGAndBUDatasOK
                + ", downloadAlgorithmDataOK = " + downloadAlgorithmDataOK
                + ",downloadSysTask" + downloadSysTaskOK
                + ", downloadRecordInfoOK = " + downloadRecordInfoOK);
        return isDataDownloadedOK();
    }

    public boolean isDataDownloadedOK() {
        return ((isDataDownloaded && (downloadUserPreferenceOK && downloadCollectedArticlesOK &&
                downloadHeadPhotoOK && downloadCompleteTaskIDsOK && downloadRecordLHAndHCGAndBUDatasOK &&
                downloadAlgorithmDataOK && downloadRecordInfoOK && downloadSysTaskOK)
                ));
    }

    public void setAllDataReady(){
        isDataDownloaded = true;
        downloadUserPreferenceOK = true;
        downloadCollectedArticlesOK = true;
        downloadHeadPhotoOK = true;
        downloadCompleteTaskIDsOK = true;
        downloadRecordLHAndHCGAndBUDatasOK = true;
        downloadAlgorithmDataOK = true;
        downloadRecordInfoOK = true;
        downloadSysTaskOK = true;
    }

}
